import request from '@/utils/request'
import defaultSettings from '@/settings'

export const apiUrlConfig = {
  queryUrl: `${defaultSettings.ctx.authorityApp}/s/tenantInfo/search`,
  exportUrl: `${defaultSettings.ctx.authorityApp}/s/tenantInfo/search`,
  delUrl: `${defaultSettings.ctx.authorityApp}/s/tenantInfo/remove`,
}

// 查询租户志列表
export function listTenantInfo(query) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/tenantInfo/search`,
    method: 'get',
    params: query
  })
}

//
export function qryTenantById(id) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/tenantInfo/qryTenantById?id=${id}`,
    method: 'get'
  })
}

// 新增或编辑字典类型
export function addOrUpdateTenant(data) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/tenantInfo/save`,
    method: 'post',
    data: data
  })
}

// 校验租户编号
export function checkTenantCode(id,tenantCode) {
  
  return request({
    url: `${defaultSettings.ctx.authorityApp}/s/tenantInfo/checkTenantCodeUnique?tenantCode=${tenantCode}&id=${id}`,
    method: 'get'
  })
}
